package com.pucong.gitee.database.backup.service.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.pucong.gitee.database.backup.common.entity.BackupTask;
import com.pucong.gitee.database.backup.common.entity.ServiceComputer;
import com.pucong.gitee.database.backup.service.service.ServiceComputerService;
import com.pucong.gitee.database.backup.utils.Res;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/backup/linux")
@Api(value = "linux服务器维护-API ", tags = "7. linux服务器维护 API")
public class ServiceComputerController {

    @Autowired
    private ServiceComputerService serviceComputerService;

    @GetMapping("/getLinuxInfoListByPage")
    @ApiOperation(value = "701分页查询", notes = "分页条件查询")
    public Res<IPage<ServiceComputer>> getTaskInfoListByPage(@ApiParam(value = "页数",example = "1")@RequestParam("pageNum") int pageNum, @ApiParam(value = "一页大小",example = "10")@RequestParam("pageSize") int pageSize, ServiceComputer serviceComputer){
        IPage<BackupTask> backupTaskIPage = serviceComputerService.getLinuxInfoListByPage(pageNum,pageSize, serviceComputer);
        return Res.ok(backupTaskIPage);
    }

}
